/*
 * @Author: szx
 * @Date: 2022-05-03 18:00:38
 * @LastEditTime: 2022-05-04 16:02:14
 * @Description:
 * @FilePath: \learn\React学习\react路由\src\pages\Home\index.jsx
 */
import React, { Component } from 'react';
import { Route, Switch, Redirect } from 'react-router-dom';
import News from './News';
import Message from './Message';
import MyNavLink from '../../components/MyNavLink';
export default class Home extends Component {
    render() {
        return (
            <div>
                <h3>我是Home的内容</h3>
                <div>
                    <ul className="nav nav-tabs">
                        <li>
                            <MyNavLink to="/home/news">News</MyNavLink>
                        </li>
                        <li>
                            <MyNavLink to="/home/message">Message</MyNavLink>
                        </li>
                    </ul>
                    <Switch>
                        <Route path="/home/news" component={News}></Route>
                        <Route path="/home/message" component={Message}></Route>
                        <Redirect to="/home/news"></Redirect>
                    </Switch>
                </div>
            </div>
        );
    }
}
